import Vue from 'vue'
import Router from 'vue-router'
import index from '@/webviews/index'
import articleDutyRecordContent from '@/webviews/articleDutyRecordContent'
import articlecontent from '@/webviews/articlecontent'
import videodetails from '@/webviews/videodetails'
import lunbocontent from '@/webviews/lunbocontent'
import searchcontent from '@/webviews/searchcontent'
import jcsjdetails from '@/webviews/jcsjdetails'
import articlelistpage from '@/webviews/articlelistpage'
import listpage from '@/webviews/listpage'
import searchresult from '@/webviews/searchresult'
import other from '@/webviews/other'
import yqlj from '@/webviews/yqlj'
import bar from '@/webviews/bar'


Vue.use(Router)

export default new Router({
  routes: [
    {path:'/',redirect:'/index'},
    { path: '/index', name: 'index', component: index },
    { path: '/articlecontent', name: 'articlecontent', component: articlecontent},
    { path: '/articleDutyRecordContent', name: 'articleDutyRecordContent', component: articleDutyRecordContent},
    { path: '/videodetails', name: 'videodetails', component: videodetails},
    { path: '/lunbocontent', name: 'lunbocontent', component: lunbocontent},
    { path: '/searchcontent', name: 'searchcontent', component: searchcontent},
    { path: '/jcsjdetails', name: 'jcsjdetails', component: jcsjdetails},
    { path: '/articlelistpage', name: 'articlelistpage', component: articlelistpage},
    { path: '/listpage', name: 'listpage', component: listpage},
    { path: '/searchresult', name: 'searchresult', component: searchresult},
    { path: '/other', name: 'other', component: other},
    { path: '/yqlj', name: 'yqlj', component: yqlj},
    { path: '/bar', name: 'bar', component: bar},
  ]
})

// 解决导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
